def generate_common_header(title, logo_text):
    return f"""
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{title}</title>
    <style>
    </style>
    <script>
        // 使用 JavaScript 生成 SVG 图标
        function generateFavicon() {{
            const logoText = "{logo_text}";
            const svgLogo = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="24">${{logoText}}</text></svg>`;
            const svgData = new Blob([svgLogo], {{type: 'image/svg+xml'}});
            const svgUrl = URL.createObjectURL(svgData);

            const link = document.createElement('link');
            link.type = 'image/svg+xml';
            link.rel = 'icon';
            link.href = svgUrl;
            document.head.appendChild(link);
        }}

        // 页面加载完成后生成 favicon
        window.addEventListener('load', generateFavicon);
    </script>
</head>
<body>
"""